import {createBrowserRouter} from "react-router";
import GeekLayout from "../pages/Layout/index.jsx";
import TaxCalculator from "../pages/Layout/TaxCalculator/index.jsx";
import CompanyInfo from "../pages/Layout/CompanyInfo/index.jsx";
import NotFound from "../pages/Layout/NotFound/index.jsx";
import PurchaseLedger from "../pages/Layout/PurchaseLedger/index.jsx";
import BackgroundMange from "../pages/Layout/BackgroundMange/index.jsx";
import Login from "@/pages/Login/index.jsx";
import UserManager from "@/pages/Layout/BackgroundMange/UserManager/index.jsx";
import UserDetail from "@/pages/Layout/BackgroundMange/UserManager/UserDetail/index.jsx";
import AddUser from "@/pages/Layout/BackgroundMange/UserManager/AddUser/index.jsx";
import UpdateUser from "@/pages/Layout/BackgroundMange/UserManager/UpdateUser/index.jsx";
import Test from "@/pages/Test/index.jsx";
import SupplierManager from "@/pages/Layout/BackgroundMange/SupplierManager/index.jsx";
import AddSupplier from "@/pages/Layout/BackgroundMange/SupplierManager/AddSupplier/index.jsx";
import UpdateSupplier from "@/pages/Layout/BackgroundMange/SupplierManager/UpdateSupplier/index.jsx";
import ApplicantManager from "@/pages/Layout/BackgroundMange/ApplicantManager/index.jsx";
import AddApplicant from "@/pages/Layout/BackgroundMange/ApplicantManager/AddApplicant/index.jsx";
import UpdateApplicant from "@/pages/Layout/BackgroundMange/ApplicantManager/UpdateApplicant/index.jsx";
import ProjectManager from "@/pages/Layout/BackgroundMange/ProjectManager/index.jsx";
import AddProject from "@/pages/Layout/BackgroundMange/ProjectManager/AddProject/index.jsx";
import UpdateProject from "@/pages/Layout/BackgroundMange/ProjectManager/UpdateProject/index.jsx";
import ProfessionalCategoryManager from "@/pages/Layout/BackgroundMange/ProfessionalCategoryManager/index.jsx";
import AddProfessionalCategory
    from "@/pages/Layout/BackgroundMange/ProfessionalCategoryManager/AddProfessionalCategory/index.jsx";
import UpdateProfessionalCategory
    from "@/pages/Layout/BackgroundMange/ProfessionalCategoryManager/UpdateProfessionalCategory/index.jsx";
import CommonMaterialsManager from "@/pages/Layout/BackgroundMange/CommonMaterials/index.jsx";
import AddCommonMaterials from "@/pages/Layout/BackgroundMange/CommonMaterials/AddCommonMaterials/index.jsx";
import UpdateCommonMaterials from "@/pages/Layout/BackgroundMange/CommonMaterials/UpdateCommonMaterials/index.jsx";
import UnitNameManger from "@/pages/Layout/BackgroundMange/UnitNameManager/index.jsx";
import AddUnitName from "@/pages/Layout/BackgroundMange/UnitNameManager/AddUnitName/index.jsx";
import UpdateUnitName from "@/pages/Layout/BackgroundMange/UnitNameManager/UpdateUnitName/index.jsx"
import PurchaseRequisition from "@/pages/Layout/PurchaseLedger/PurchaseRequisition/index.jsx";
import PurchaseOrder from "@/pages/Layout/PurchaseLedger/PurchaseOrder/index.jsx";
import PaymentRequest from "@/pages/Layout/PurchaseLedger/PaymentRequest/index.jsx";

const router = createBrowserRouter([
    {
        path: '/',
        element: <GeekLayout />,
        children: [
            {
                path: '/',
                element: <PurchaseLedger />,
                children:[
                    {
                        path:`/purchaseLedger/purchaseRequisition`,
                        element: <PurchaseRequisition/>
                    },
                    {
                        path:`/purchaseLedger/purchaseOrder`,
                        element: <PurchaseOrder/>
                    },
                    {
                        path:`/purchaseLedger/paymentRequest`,
                        element: <PaymentRequest/>
                    },
                ]
            },
            {
                path: '/companyInfo',
                element: <CompanyInfo />
            },
            {
                path: '/taxCalculator',
                element: <TaxCalculator />
            },
            {
                path: '/backgroundManage',
                element: <BackgroundMange />,
                children:[
                    {
                        path:'/backgroundManage/user',
                        element:<UserManager/>,
                    },


                    {
                        path:'/backgroundManage/supplier',
                        element:<SupplierManager/>,
                    },
                    {
                        path:'/backgroundManage/addSupplier',
                        element:<AddSupplier/>,
                    },
                    {
                        path:`/backgroundManage/updateSupplier/:id`,
                        element:<UpdateSupplier/>,
                    },


                    {
                        path:`/backgroundManage/applicant`,
                        element:<ApplicantManager/>,
                    },
                    {
                        path:`/backgroundManage/addApplicant`,
                        element:<AddApplicant/>,
                    },
                    {
                        path:`/backgroundManage/updateApplicant/:id`,
                        element:<UpdateApplicant/>,
                    },


                    {
                        path:`/backgroundManage/project`,
                        element:<ProjectManager/>,
                    },
                    {
                        path:`/backgroundManage/addProject`,
                        element:<AddProject/>,
                    },
                    {
                        path:`/backgroundManage/updateProject/:id`,
                        element:<UpdateProject/>,
                    },


                    {
                        path:`/backgroundManage/professionalCategory`,
                        element:<ProfessionalCategoryManager/>,
                    },
                    {
                        path:`/backgroundManage/addProfessionalCategory`,
                        element:<AddProfessionalCategory/>,
                    },
                    {
                        path:`/backgroundManage/updateProfessionalCategory/:id`,
                        element:<UpdateProfessionalCategory/>,
                    },

                    {
                        path:`/backgroundManage/commonMaterials`,
                        element:<CommonMaterialsManager/>,
                    },
                    {
                        path:`/backgroundManage/addCommonMaterials`,
                        element:<AddCommonMaterials/>,
                    },
                    {
                        path:`/backgroundManage/updateCommonMaterials/:id`,
                        element:<UpdateCommonMaterials/>,
                    },


                    {
                        path:`/backgroundManage/unitNameList`,
                        element:<UnitNameManger/>
                    },
                    {
                        path:`/backgroundManage/addUnitName`,
                        element:<AddUnitName/>
                    },{
                        path:`/backgroundManage/updateUnitName/:id`,
                        element:<UpdateUnitName/>
                    },

                ]
            },
            {
                path:'/backgroundManage/user/:id',
                element:<UserDetail/>
            },
            {
                path:'/backgroundManage/addUser',
                element:<AddUser/>
            },
            {
                path:'/backgroundManage/updateUser/:id',
                element:<UpdateUser/>
            },
            {
                path:'/test',
                element:<Test/>
            },
        ]
    },
    {
        path:'/login',
        element:<Login/>

    },

    {
        path: '*',
        element: <NotFound />
    }
])

export default router